package ysq.xyg.web.model.po;

import lombok.Data;
import lombok.NoArgsConstructor;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 商城模块-提现表实体类
 *
 * @author congcong tao
 * @date 2019-4-28 11:19:58
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_web_withdraw")
public class WebWithdraw implements Serializable{

	/**
     * 主键
     */
	@Id
	private String id;

	/**
	 * 应用主键
	 */
	@Column(name = "account_id")
	private String accountId;

	/**
     * 会员
     */
	@Column(name = "member_id")
	private String memberId;

	/**
     * 金额
     */
	@Column(name = "money")
	private String money;

	/**
     * 支付宝号
     */
	@Column(name = "alipay")
	private String alipay;

	/**
     * 银行卡号
     */
	@Column(name = "bank_card")
	private String bankCard;

	/**
	 * 1=支付宝打款、2=微信打款、3=线下打款（code码）
	 */
	@Column(name = "type")
	private String type;

	/**
     * 状态1审核中2审核完成3审核失败
     */
	@Column(name = "status")
	private String status;

	/**
     * 状态1、打款成功，2、打款失败
     */
	@Column(name = "manage_status")
	private String manageStatus;

	/**
     * 描述
     */
	@Column(name = "description")
	private String description;

	/**
     * 申请时间
     */
	@Column(name = "apply_time")
	private Date applyTime;

	/**
     * 处理时间
     */
	@Column(name = "manage_time")
	private Date manageTime;

	/**
     * 创建者
     */
	@Column(name = "create_user")
	private String createUser;

	/**
     * 创建时间
     */
	@Column(name = "create_time")
	private Date createTime;

	/**
     * 删除状态1、未删除2、已删除
     */
	@Column(name = "remove_tag")
	private String removeTag;

	/**
     * 更新者
     */
	@Column(name = "update_user")
	private String updateUser;

	/**
     * 更新时间
     */
	@Column(name = "update_time")
	private Date updateTime;

	@Transient
	private String memberCardNo;

	@Transient
	private String memberNickName;

	@Transient
	private String memberName;

	@Transient
	private String memberPhone;

	@Transient
	private String createTimeStr;

	public WebWithdraw(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.accountId = sysUser.getAccountId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}